<%@ page contentType="text/html; charset=utf-8" %>

<%@ include file="/WEB-INF/jsp/includeTop.jsp" %>

<table width="100%" border="0" cellpadding="0" cellspacing="5">
  <tr>
    <td valign="top">
      <table class="dbborder" width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="bottom" class="blueTableBg">&nbsp;我的计划任务&nbsp;-&nbsp;新增备忘</td>
        </tr>
        <tr>
          <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="5">
              <tr>
                <td>
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td class="dashTopLeft"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashTop" width=100%><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashTopRight"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashLeft"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td align="center">
                        <table width="100%" border="0" cellpadding="0" cellspacing="3">
													<form:form commandName="memoForm">
                          <tr>
                            <td width="114" height="20" class="globalText">终端名称</td>
				                    <td height="20" class="globalText">
                            	<input type="hidden" name="channelCode" id="channelCode"/>
				                    	<input id="channelNamePickedFrom" onclick="javascript:var rtnVal=window.showModalDialog('<c:url value="/channelList.html" />',window,'status:no;resizable:no;directories:no;help:no;scroll:no;dialogWidth=800px;dialogHeight=600px;dialogLeft:500px;dialogTop:300px;');
										 							   if(typeof(rtnVal)!='undefined') {document.getElementById('channelCode').value=rtnVal[0];document.getElementById('channelNamePickedFrom').value=rtnVal[1];}" readonly="readonly" type="text" class="txtbox" size="20" name="channelNamePickedFrom" value="" />
				                    </td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                          	<td width="114" height="20" class="globalText">备忘内容</td>
                            <td width="114" height="20" class="globalText" >
                            	<textarea id="memoContent" name="memoContent" rows="5" cols="100"></textarea>                   	
                            </td>
                          </tr>
                          <tr>
                            <td align="center" colspan="2">
                              <table border="0" cellpadding="0" cellspacing="2">
                                <tr>
                                  <td><input type="button" class="btnStyle" value="  保存  " onclick="javascript:doSubmit()"></td>
                                  <td>
                                  	&nbsp;
                                  </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
												</form:form>
                        </table>
                      </td>
                      <td class="dashRight"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashBottomLeft"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashBottom" width=100%><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashBottomRight"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<script type="text/javascript">
	function doSubmit() {

    var channelNamePickedFrom = document.getElementById("channelNamePickedFrom").value.trim();
		if (validateEmpty(channelNamePickedFrom)) {
			alert("终端名称 不能为空");
			return false;
		}

    var channelCode = document.getElementById("channelCode").value.trim();
		if (validateEmpty(channelCode)) {
			alert("终端编号 数据异常");
			return false;
		}

    var memoContent = document.getElementById("memoContent").value.trim();
		if (validateEmpty(memoContent)) {
			alert("备忘内容 不能为空");
			return false;
		}
    
		document.getElementById("memoForm").action = "<c:url value='/plan/newMemo.html' />";
    document.getElementById("memoForm").method="post";
		document.getElementById("memoForm").submit();
	}
	
	function doCancel() {
		document.getElementById("memoForm").action = "<c:url value='/planMain.html' />";	
		document.getElementById("memoForm").submit();
	}

</script>
